<?php

namespace App\Console\Commands;

use App\Extend\Airwallex;
use App\Extend\IPweb;
use App\Extend\Payssion;
use App\Extend\Usdt;
use App\Models\DistributorUser;
use App\Models\User;
use App\Services\ProxyService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;

class DataHandle extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:dataHandle';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '多类型流量查询';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        dd((new ProxyService())->createStaticOrder('298040', 'IPX20250905142158447973'));
        $users = User::where('invite_userid', '>', 0)->get();
        foreach ($users as $user) {
            $channel_value = DistributorUser::where('user_id', $user->invite_userid)->value('invite_code');
            if (empty($channel_value)) {
                continue;
            }
            $user->channel_key = 'hz';
            $user->channel_value = $channel_value;
            $user->save();
        }
    }
}
